package com.todo.partner.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author zhangwenxiang
 * @date 2024/3/17 22:25
 * @description
 */
@Getter
@AllArgsConstructor
public enum PartnerContentTypeEnum {

    TRAVEL_PARTNER(1, "TRAVEL_PARTNER", "旅游搭子"),
    FOOD_PARTNER(2, "FOOD_PARTNER", "美食搭子"),
    WEEKEND_PARTNER(3, "WEEKEND_PARTNER", "周末搭子"),
    WINE_PARTNER(4, "WINE_PARTNER", "酒搭子"),
    CLIMBED_PARTNER(5, "CLIMBED_PARTNER", "爬山搭子"),
    FOOT_PARTNER(6, "FOOT_PARTNER", "徒步搭子"),
    STUDY_PARTNER(7, "STUDY_PARTNER", "学习搭子"),
    MUSIC_FESTIVAL_PARTNER(8, "MUSIC_FESTIVAL_PARTNER", "音乐节搭子"),

    ;

    private static Map<Integer, PartnerContentTypeEnum> typeMap = Arrays
            .stream(PartnerContentTypeEnum.values())
            .collect(Collectors.toMap(PartnerContentTypeEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static PartnerContentTypeEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
